<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>糖果盒</title>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<meta name="keywords" content="糖果盒,创世空,win8,卡片式布局" />
	<meta http-equiv="Cache-Control" content="no-store"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>
	<link type="text/css" rel="stylesheet" href="css/pepper-grinder/jquery-ui-1.8.16.custom.css" />
	<link type="text/css" rel="stylesheet" href="css/login.css" />
	<link type="text/css" rel="stylesheet" href="css/slidelock.css" />
	<link type="text/css" rel="stylesheet" href="css/popeWin.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="js/slidelock.js"></script>
	<script type="text/javascript" src="js/popeWin.js"></script>
	<script language="JavaScript" type="text/JavaScript">
		var divhtml;
		$(document).ready(function() {	
			refreash();
			$(window).resize(function() {
				refreash();
			});
			divhtml = $("#regdiv").html();
			$("#regdiv").empty();
			
			
		});
		function refreash(){
			winheight = $(window).height();
			winwidth = $(window).width();
			$("body").css("height",winheight);
		}
		function changeInputPwd(type){
			if(type==1){
				$("#user_pwd_slide").hide();
				$("#user_pwd_input").toggle();
				$("#login_btn").toggle();
				if($("#img1").attr("src")=="image/cover/system/blue/MB_0036_keyboard.png"){
					$("#img1").attr("src","image/cover/system/white/MB_0036_keyboard.png");
				}else{
					$("#img1").attr("src","image/cover/system/blue/MB_0036_keyboard.png");
				}
				$("#img2").attr("src","image/cover/system/white/MB_0035_keyboard2.png");
				$("#img2").popeSlideLock({close:true}); 
			}else if(type==2){
				$("#user_pwd_input").hide();
				$("#login_btn").hide();
				if($("#img2").attr("src")=="image/cover/system/blue/MB_0035_keyboard2.png"){
					$("#img2").attr("src","image/cover/system/white/MB_0035_keyboard2.png");
				}else{
					$("#img2").attr("src","image/cover/system/blue/MB_0035_keyboard2.png");
				}
				$("#img1").attr("src","image/cover/system/white/MB_0036_keyboard.png");
				$("#img2").popeSlideLock({
					callback:function(val){
						$("#slidePwd").attr("value",val);
						$("#pwd").attr("value","");
						login();
					}
				}); 
			}
		}
		/**document.onkeydown = function(event) {
			var e = event ? event :(window.event ? window.event : null);
			if(e.keyCode == 13) {
				login();
			}
			
		}**/
		function sub(){
			$("#slidePwd").attr("value","");
			login();
		}
		function login(){
			var loginName = $("#loginName").val();
			var pwd = $("#pwd").val();
			var slidePwd = $("#slidePwd").val();
			$.get("account_login.do",{loginName:loginName,pwd:pwd,slidePwd:slidePwd},function(data){
				if(data=="success"){
					window.location.href = "index4.html";
				}else{
					$("#login_error h4").html(data);
					$("#login_error").show();
				}
			});
		}
		function openReg(){
			$.popeWinMini({
				id:"reg_img1",
				width:300,
				height:160,
				content:divhtml
			});
			$("#reg_img1").hide();
			$("#reg_img2").show();
		}
		function closeReg(){
			$.popeWinMiniClose({
				id:"reg_img1"
			});
			$("#reg_img2").hide();
			$("#reg_img1").show();
			$("#slide1").popeSlideLock({close:true}); 
			$("#slide2").popeSlideLock({close:true}); 
		}
		function cli1(){
			$("#slide2").popeSlideLock({close:true}); 
			$("#slide1").popeSlideLock({
				callback:function(val){
					$("#regSlidePwd").val(val);
					$("#slide1").popeSlideLock({close:true}); 
				}
			}); 
		}
		function cli2(){
			$("#slide1").popeSlideLock({close:true}); 
			$("#slide2").popeSlideLock({
				callback:function(val){
					if(val!=$("#regSlidePwd").val()){
						//alert("滑动密码不一致");
						$("#error_div h4").html("滑动密码不一致");
						$("#error_div").show();
						return;
					}
					$("#reRegSlidePwd").val(val);
					$("#slide2").popeSlideLock({close:true}); 
					$("#error_div h4").empty();
					$("#error_div").hide();
				}
			});
		}
		function reg(){
			var loginName = $("#regLoginName").val();
			var pwd = $("#regPwd").val();
			var pwd1 = $("#regRePwd").val();
			var slidePwd1 = $("#reRegSlidePwd").val();
			var slidePwd = $("#regSlidePwd").val();
			if(loginName==""){
				$("#error_div h4").html("账号为空");
				$("#error_div").show();
				return;
			}
			if(loginName.length>20){
				$("#error_div h4").html("账号过长");
				$("#error_div").show();
				return;
			}
			if(pwd==""){
				$("#error_div h4").html("密码为空");
				$("#error_div").show();
				return;
			}
			if(pwd.length>20){
				$("#error_div h4").html("密码过长");
				$("#error_div").show();
				return;
			}
			if(slidePwd==""){
				$("#error_div h4").html("滑动密码为空");
				$("#error_div").show();
				return;
			}
			if(pwd!=pwd1){
				//alert("密码不一致");
				$("#error_div h4").html("密码不一致");
				$("#error_div").show();
				return;
			}
			if(slidePwd!=slidePwd1){
				//alert("滑动密码不一致");
				$("#error_div h4").html("滑动密码不一致");
				$("#error_div").show();
				return;
			}
			$.get("account_regist.do",{loginName:loginName,pwd:pwd,slidePwd:slidePwd},function(data){
				if(data=="success"){
					//alert("注册成功");
					$("#error_div h4").css("color","green");
					$("#error_div h4").html("注册成功");
					$("#error_div").show();
					closeReg();
					setTimeout("hideRegSuccess()",3000);
				}else{
					//alert("注册失败");
					$("#error_div h4").html("注册失败");
					$("#error_div").show();
					
				}
			});
		}
		
		function hideRegSuccess(){
			$("#error_div h4").css("color","red");
			$("#error_div h4").empty();
			$("#error_div").hide();
		}
		
		function resetReg(){
			$("#regLoginName").val("");
			$("#regPwd").val("");
			$("#regRePwd").val("");
			$("#reRegSlidePwd").val("");
			$("#regSlidePwd").val("");
			$("#error_div h4").empty();
			$("#error_div").hide();
		}
	</script>
	
</head>
<body>
	<div id="layout">
		<div id="wraper">
			<div id="header">
				<div class="reg_btn" id="reg_btn">
					<img id="reg_img1" src="image/cover/others/white/MB_0019_plus.png" title="注册" onclick="openReg()" />
					<img id="reg_img2" style="display: none;" src="image/cover/others/white/MB_0019_plus2.png" title="收起注册" onclick="closeReg()" />
				</div>
				<div style="position: absolute;left: 90px;top: 30px;">
					<h3 style="color: #fff">注册</h3>
				</div>
				<div id="error_div" style="position: absolute;left: 150px;top: 45px;display: none">
					<h4 style="color: red"></h4>
				</div>
			</div>
			<div id="main">
				<div class="mod_slogan">
					<div class="bn_box">
						<img src="image/login/box.png" style="margin-top: 100px;" id="pic_loop_0">
					</div>
				</div>
				<div class="mod_login">
					<div class="login_box">
						<div id="login_div">
							<div class="login_error" id="login_error" style="position: absolute;left: 140px;top: -10px;display: none;">
								<h4 style="color: red"></h4>
							</div>								
							<div class="user_name_input" id="user_name_input">
								<input type="text" tabindex="1" name="loginName" maxlength="50" id="loginName"
									class="ptname inputtxt" placeholder="个性化帐号">
							</div>
							<div class="user_pwd_input" id="user_pwd_input" style="display: none;">
								<input type="password" maxlength="40" tabindex="2"
									class="ptpwd inputtxt" name="pwd" id="pwd" placeholder="密码">
								<input type="hidden" name="slidePwd" id="slidePwd" />
							</div>
							<div class="login_btn" id="login_btn" style="display: none;">
								<img onclick="sub();" title="登录" src="image/cover/system/white/MB_0006_go.png" tabindex="3" class="btn_user_login" id="btn_user_login">
							</div>
							<div class="normal-input-pwd" id="normal-input-pwd">
								<img id="img1" src="image/cover/system/white/MB_0036_keyboard.png" title="文字密码" onclick="changeInputPwd(1)" />
							</div>
							<div class="slide-input-pwd" id="slide-input-pwd">
								<img id="img2" src="image/cover/system/white/MB_0035_keyboard2.png" title="滑动密码" onclick="changeInputPwd(2)" />
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 
	<div class="mod_footer" id="mod_footer">
		<p class="footer">
			苏ICP备10226603号-5 &nbsp;&nbsp;&nbsp;&copy2012创世空版权所有
			<a href="#">XX网</a>
			<a target="_blank" href="#">关于我们</a>
			<a rel="nofollow" target="_blank" href="#">友情链接</a>
			<a rel="nofollow" href="#" id="conService">在线客服</a>
			<a rel="nofollow" target="_blank" title="沈阳工商" href="#"><img src="image/login/1.png"></a>
		</p>
	</div> -->
	<div id="regdiv" style="display:none;"> 
		<div style="width:300px;height:160px;float:left;color:#fff;font-size:12px;line-height:22px;border:#fff solid 2px;">
			<div style="float:left;width:100%;">
				<div style="width:120px;float:left;text-align:right;">账    号：</div>
				<div style="width:180px;float:left;"><input style="" type="text" id="regLoginName" /></div>
				<div id="regLoginNameError" style="width:120px;float:left;text-align:left;color: red;display:none;"></div>
			</div>
			<div style="float:left;width:100%;">
				<div style="width:120px;float:left;text-align:right;">密    码：</div>
				<div style="width:180px;float:left;"><input type="password"" id="regPwd" /></div>
				<div id="regPwdError" style="width:120px;float:left;text-align:left;color: red;display:none;"></div>
			</div>
			<div style="float:left;width:100%;">
				<div style="width:120px;float:left;text-align:right;">确认密码：</div>
				<div style="width:180px;float:left;"><input type="password"" id="regRePwd" /></div>
				<div id="regRePwdError" style="width:120px;float:left;text-align:left;color: red;display:none;"></div>
			</div>
			<div style="float:left;width:100%;">
				<div style="width:120px;float:left;text-align:right;line-height:26px;">滑动密码：</div>
				<div style="width:180px;float:left;"><img id="slide1" onclick="cli1()" title="点击滑动" src="image/cover/system/white/MB_0035_keyboard2.png" style="width:20px;height:20px;cursor:pointer;padding-top:2px;" /></div>
				<div id="regSlidePwdError" style="width:120px;float:left;text-align:left;color: red;display:none;"></div>
			</div>
			<div style="float:left;width:100%;border-bottom:#fff solid 1px;">
				<div style="width:120px;float:left;text-align:right;line-height:26px;">再次滑动：</div>
				<div style="width:180px;float:left;"><img id="slide2" onclick="cli2()" title="点击滑动" src="image/cover/system/white/MB_0035_keyboard2.png" style="width:20px;height:20px;cursor:pointer;padding-top:2px;" /></div>
				<div id="reRegSlidePwdError" style="width:120px;float:left;text-align:left;color: red;display:none;"></div>
			</div>
			<div style="text-align:center;float:left;width:100%;padding-top:3px;" >
				<img onclick="reg();" title="保存" src="image/cover/system/white/MB_0008_save.png" style="width:24px;height:24px;cursor:pointer;" />
				<img onclick="resetReg();" title="重置" src="image/cover/system/white/MB_0015_reload.png" style="width:24px;height:24px;cursor:pointer;" />
			</div>
			<input type="hidden" id="regSlidePwd" />
			<input type="hidden" id="reRegSlidePwd" />
		</div>
	</div>
</body>
</html>